home *** CD-ROM | disk | FTP | other *** search
- Path: news.nask.org.pl!usenet
- From: flssoft@blue.maloka.waw.pl (Grzegorz (FLS))
- Newsgroups: comp.lang.c++
- Subject: Re: Visual C++ help needed!!!!(please)
- Date: Mon, 01 Apr 1996 22:22:29 GMT
- Organization: Research and Academic Computer Network
- Message-ID: <4jph92$fq9@bilbo.nask.org.pl>
- References: <4jn1cn$7vo@crash.microserve.net> <4jnb8f$18u8@mule2.mindspring.com>
- NNTP-Posting-Host: s112.maloka.waw.pl
- X-Newsreader: Forte Free Agent v0.46
-
- rudd@mindspring.com (Justin Rudd) wrote:
-
- >ada105@psu.edu (Alexander Achey) wrote:
-
- >> Hi all,
- >> I'm attempting to write a Visual C++ program in which I am making it
- >>come up with schedules of college courses. I use a modal dialog box
- >>to get some information from the user and then I need to have it put
- >>this data somewhere I can use it after the box is closed. I tried
- >>putting the variables under the public part of the document class, but
- >>I can't seem to use the GetDocument() function from the dialog box.
- >>Is there any other way to get access to the document's member
- >>functions or is there a better way to do this? i tried declaring this
- >>as a global variable, but I really don't want to do that. Besides, I
- >>keep getign redinifition errors when I do that. I'd really
- >>apprecitate it if anyone could give me any kind of help.
-
- >In your dialog class have a member function that accepts a pointer to
- >a CDocument.
-
- >void CMyDialog::SetDocPtr(CMyDoc* pDoc)
- >{
- > m_pDoc = pDoc;
- >}
-
-
- Hi Alexander and Justin,
-
- I do not think, that declaring <SetDocPtr()> method is a good solution
- (however it is not bad anyway ;)).
- The solution, is to use local (public) members in CMyDialog dialog.
- For example
-
- class CMyDialog : public CDialog
- {
- ....
- public: // input/outpu members
- int m_int_var ;
- CString m_string_var ;
- // ... etc. Sorry for members names.
- }
-
- When you want to use CMyDialog, you can do:
-
- CMyDoc::OnEditMyDialog()
- {
- CMyDialog dlg ;
-
- if ( dlg.DoModal() == IDOK )
- {
- // do something with dlg.m_int_var
- // do something with dlg.m_string_var
- // for example:
- m_doc_int_var = dlg.m_int_var ;
- m_doc_string_var = dlg.m_string_var ;
- }
- }
-
-
- Regards,
- Grzegorz.
-
-
-